package xy.customer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import xy.customer.entity.User;

@RestController
public class MovieController {
	
	@Autowired
	private RestTemplate restTemplate;
	
	@GetMapping("/coustomer/{id}")
	public User findById(@PathVariable Long id) {
		
		return this.restTemplate.getForObject("http://xy-server:7080/simple/"+id, User.class);
		
	}
	

}
